Skip to content

Address security issues in the signup module#667

Open
vagisha wants to merge 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_signup-security
Open

Address security issues in the signup module#667
vagisha wants to merge 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_signup-security

Conversation

@vagisha

@vagisha vagisha commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Rationale

This PR addresses the security issues found in the signup module following an internal review. It tightens validation on self-service group changes, makes signup responses consistent, improves auditing of administrative changes, and avoids surfacing internal mail errors to callers.

Security review findings (signup module)

The review flagged six items in the signup module. Four are addressed by this PR; the two rate-limiting items were already handled by the kaptcha work in #638.

  • [Low-Med] Self-service group change did not re-validate the resolved groups before changing membership, so a misconfigured transition rule could move a user into a more-privileged, site, or other-project group. Addressed here.
  • [Low] Signup responses differed depending on whether the submitted address already had an account. Addressed here.
  • [Low] Administrative configuration actions wrote no audit event on success (group-change rules and per-folder target group). Addressed here.
  • [Low] The unauthenticated signup endpoint could send mail without rate limiting. Addressed by kaptcha in Add kaptcha verification to signup module #638.
  • [Informational] No rate limiting on the unauthenticated signup email endpoints. Addressed by kaptcha in Add kaptcha verification to signup module #638.
  • [Informational] Mail-send errors were returned to the caller. Addressed here.

Related Pull Requests

Changes

  • Group-change validation. The self-service group change re-validates the resolved groups before changing any membership: both must be project groups in the same project, and the target must not carry administrative permission in the project or any of its subfolders. Requests that don't meet these constraints are rejected with a distinct status, and successful moves are audited.
  • Consistent signup responses. The signup endpoints return the same response whether or not an address already has an account, including when email delivery fails. The owner of an existing address receives a notice pointing to the password-reset flow, and the existing account is never modified.
  • Auditing. The administrative configuration actions now write an audit event on success.
  • Error handling. Mail-send errors are logged server-side, and callers receive a generic message.
  • Test. Added SignUpGroupChangeSecurityTest, covering the group-change validation and its auditing.

Deployment note. Two DB-stored wiki pages on the skyline website need updating after deployment: the signup form should branch on status == 'SUCCESS', and the Skyline-daily register form should handle the TARGET_NOT_ALLOWED status returned by a rejected group change (plus a fallback for any unrecognized status).

Co-Authored-By: Claude noreply@anthropic.com

vagisha and others added 6 commits July 24, 2026 17:56
… that carries AdminPermission (admin rights) in any subfolder of the

project, not only at the project root.

Co-Authored-By: Claude <noreply@anthropic.com>
* SignUpApiAction and BeginAction now email the owner of an already-registered
  address (new sendExistingAccountEmail helper) instead of doing nothing. Both
  signup paths now send an email, so response timing no longer reveals whether
  an account exists.
* The existing account is never modified, and send failures are logged and
  swallowed so the response stays identical to a new signup. The email points
  the owner to the "Forgot your password?" reset flow.
* Renamed the SignUpApiAction success status from USER_ADDED to SUCCESS, which
  was misleading in the existing-account case where no user is added. The
  external signup wiki form must key its success branch off SUCCESS.

Co-Authored-By: Claude <noreply@anthropic.com>
…ion status

* ChangeGroupsApiAction returns TARGET_NOT_ALLOWED when validateGroupChangeTarget refuses a privileged, site, or cross-project target. NO_PERMISSIONS still covers callers that are ineligible for the transition.
* Added SignUpGroupChangeSecurityTest. As a non-admin it plants each dangerous transition rule, then verifies the move is refused and membership unchanged, while a plain same-project move still succeeds.

Co-Authored-By: Claude <noreply@anthropic.com>
…e group-change test

* SignUpApiAction and BeginAction now run the existing-account and new-account branches through one try/catch, so a mail-send failure returns the same generic error for both.
* SignUpGroupChangeSecurityTest now verifies through the auditLog schema that a successful self-service group change adds one "Client API Actions" event and a refused move adds none, comparing counts before and after each move since the event is recorded in the root container that outlives project cleanup.

See ai/todos/active/TODO-LK-20260723_signup-security.md

Co-Authored-By: Claude <noreply@anthropic.com>
* SignUpApiAction and BeginAction also catch SQLException from the new-account insert, so a DB failure returns the same generic error as any other and cannot reveal whether the account existed.
* validateGroupChangeTarget drops the workbook-only container filter and its stale comment. The admin check is unchanged.
* RemoveGroupChangeProperty now guards against a null rule map and removes the entry with the correct string key. Group-change audit events log group names instead of bare ids.
* SignUpGroupChangeSecurityTest adds a case for a target that inherits admin via membership in an admin group.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the signup module by preventing privilege escalation through self-service group changes, making signup responses non-enumerable, improving audit logging of admin configuration changes, and ensuring mail-send failures don’t leak internal details to callers.

Changes:

  • Adds server-side validation for self-service group transitions to block moves into site groups, cross-project groups, or any group with administrative permission anywhere in the project tree; successful moves are now audited.
  • Makes signup responses uniform whether or not the email already has an account (and logs internal mail errors while returning a generic message).
  • Adds an integration test (SignUpGroupChangeSecurityTest) that verifies group-change validation and audit behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
signup/src/org/labkey/signup/SignUpController.java Adds audit logging, uniform signup behavior, and target validation for self-service group moves.
signup/test/src/org/labkey/test/tests/signup/SignUpGroupChangeSecurityTest.java New test covering group-change security validation and auditing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread signup/src/org/labkey/signup/SignUpController.java
@vagisha
vagisha marked this pull request as ready for review July 26, 2026 22:56
@vagisha
vagisha requested a review from labkey-jeckels July 26, 2026 22:56
…dit message, matching the admin-config audit events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants